3.5.6 \(\int (d \tan (e+f x))^m (a+b \sqrt {c \tan (e+f x)})^2 \, dx\) [406]

3.5.6.1 Optimal result
3.5.6.2 Mathematica [A] (verified)
3.5.6.3 Rubi [A] (warning: unable to verify)
3.5.6.4 Maple [F]
3.5.6.5 Fricas [F]
3.5.6.6 Sympy [F]
3.5.6.7 Maxima [F]
3.5.6.8 Giac [F(-2)]
3.5.6.9 Mupad [F(-1)]

3.5.6.1 Optimal result

Integrand size = 29, antiderivative size = 212 \[ \int (d \tan (e+f x))^m \left (a+b \sqrt {c \tan (e+f x)}\right )^2 \, dx=\frac {\left (a^2-b^2 \sqrt {-c^2}\right ) \operatorname {Hypergeometric2F1}\left (1,1+m,2+m,-\frac {c \tan (e+f x)}{\sqrt {-c^2}}\right ) \tan (e+f x) (d \tan (e+f x))^m}{2 f (1+m)}+\frac {\left (a^2+b^2 \sqrt {-c^2}\right ) \operatorname {Hypergeometric2F1}\left (1,1+m,2+m,\frac {c \tan (e+f x)}{\sqrt {-c^2}}\right ) \tan (e+f x) (d \tan (e+f x))^m}{2 f (1+m)}+\frac {4 a b \operatorname {Hypergeometric2F1}\left (1,\frac {1}{4} (3+2 m),\frac {1}{4} (7+2 m),-\tan ^2(e+f x)\right ) (c \tan (e+f x))^{3/2} (d \tan (e+f x))^m}{c f (3+2 m)} \]

output
1/2*hypergeom([1, 1+m],[2+m],-c*tan(f*x+e)/(-c^2)^(1/2))*(a^2-b^2*(-c^2)^( 
1/2))*tan(f*x+e)*(d*tan(f*x+e))^m/f/(1+m)+1/2*hypergeom([1, 1+m],[2+m],c*t 
an(f*x+e)/(-c^2)^(1/2))*(a^2+b^2*(-c^2)^(1/2))*tan(f*x+e)*(d*tan(f*x+e))^m 
/f/(1+m)+4*a*b*hypergeom([1, 3/4+1/2*m],[7/4+1/2*m],-tan(f*x+e)^2)*(c*tan( 
f*x+e))^(3/2)*(d*tan(f*x+e))^m/c/f/(3+2*m)
 
3.5.6.2 Mathematica [A] (verified)

Time = 1.58 (sec) , antiderivative size = 151, normalized size of antiderivative = 0.71 \[ \int (d \tan (e+f x))^m \left (a+b \sqrt {c \tan (e+f x)}\right )^2 \, dx=\frac {\tan (e+f x) (d \tan (e+f x))^m \left (\frac {a^2 \operatorname {Hypergeometric2F1}\left (1,\frac {1+m}{2},\frac {3+m}{2},-\tan ^2(e+f x)\right )}{1+m}+b \left (\frac {b c \operatorname {Hypergeometric2F1}\left (1,\frac {2+m}{2},\frac {4+m}{2},-\tan ^2(e+f x)\right ) \tan (e+f x)}{2+m}+\frac {4 a \operatorname {Hypergeometric2F1}\left (1,\frac {1}{4} (3+2 m),\frac {1}{4} (7+2 m),-\tan ^2(e+f x)\right ) \sqrt {c \tan (e+f x)}}{3+2 m}\right )\right )}{f} \]

input
Integrate[(d*Tan[e + f*x])^m*(a + b*Sqrt[c*Tan[e + f*x]])^2,x]
 
output
(Tan[e + f*x]*(d*Tan[e + f*x])^m*((a^2*Hypergeometric2F1[1, (1 + m)/2, (3 
+ m)/2, -Tan[e + f*x]^2])/(1 + m) + b*((b*c*Hypergeometric2F1[1, (2 + m)/2 
, (4 + m)/2, -Tan[e + f*x]^2]*Tan[e + f*x])/(2 + m) + (4*a*Hypergeometric2 
F1[1, (3 + 2*m)/4, (7 + 2*m)/4, -Tan[e + f*x]^2]*Sqrt[c*Tan[e + f*x]])/(3 
+ 2*m))))/f
 
3.5.6.3 Rubi [A] (warning: unable to verify)

Time = 0.87 (sec) , antiderivative size = 239, normalized size of antiderivative = 1.13, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {3042, 4153, 7267, 30, 2370, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (d \tan (e+f x))^m \left (a+b \sqrt {c \tan (e+f x)}\right )^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (d \tan (e+f x))^m \left (a+b \sqrt {c \tan (e+f x)}\right )^2dx\)

\(\Big \downarrow \) 4153

\(\displaystyle \frac {c \int \frac {(d \tan (e+f x))^m \left (a+b \sqrt {c \tan (e+f x)}\right )^2}{\tan ^2(e+f x) c^2+c^2}d(c \tan (e+f x))}{f}\)

\(\Big \downarrow \) 7267

\(\displaystyle \frac {2 c \int \frac {\sqrt {c \tan (e+f x)} \left (c d \tan ^2(e+f x)\right )^m (a+b c \tan (e+f x))^2}{c^4 \tan ^4(e+f x)+c^2}d\sqrt {c \tan (e+f x)}}{f}\)

\(\Big \downarrow \) 30

\(\displaystyle \frac {2 c (c \tan (e+f x))^{-m} \left (c d \tan ^2(e+f x)\right )^m \int \frac {(c \tan (e+f x))^{\frac {1}{2} (2 m+1)} \left (a+b \sqrt {c \tan (e+f x)}\right )^2}{c^4 \tan ^4(e+f x)+c^2}d\sqrt {c \tan (e+f x)}}{f}\)

\(\Big \downarrow \) 2370

\(\displaystyle \frac {2 c (c \tan (e+f x))^{-m} \left (c d \tan ^2(e+f x)\right )^m \int \left (\frac {\left (a^2+b^2 c^2 \tan ^2(e+f x)\right ) (c \tan (e+f x))^{\frac {1}{2} (2 m+1)}}{c^4 \tan ^4(e+f x)+c^2}+\frac {2 a b (c \tan (e+f x))^{\frac {1}{2} (2 m+2)}}{c^4 \tan ^4(e+f x)+c^2}\right )d\sqrt {c \tan (e+f x)}}{f}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {2 c (c \tan (e+f x))^{-m} \left (c d \tan ^2(e+f x)\right )^m \left (\frac {\left (a^2-b^2 \sqrt {-c^2}\right ) (c \tan (e+f x))^{m+1} \operatorname {Hypergeometric2F1}\left (1,m+1,m+2,-\frac {c^2 \tan ^2(e+f x)}{\sqrt {-c^2}}\right )}{4 c^2 (m+1)}+\frac {\left (a^2+b^2 \sqrt {-c^2}\right ) (c \tan (e+f x))^{m+1} \operatorname {Hypergeometric2F1}\left (1,m+1,m+2,\frac {c^2 \tan ^2(e+f x)}{\sqrt {-c^2}}\right )}{4 c^2 (m+1)}+\frac {2 a b (c \tan (e+f x))^{\frac {1}{2} (2 m+3)} \operatorname {Hypergeometric2F1}\left (1,\frac {1}{4} (2 m+3),\frac {1}{4} (2 m+7),-c^2 \tan ^4(e+f x)\right )}{c^2 (2 m+3)}\right )}{f}\)

input
Int[(d*Tan[e + f*x])^m*(a + b*Sqrt[c*Tan[e + f*x]])^2,x]
 
output
(2*c*(c*d*Tan[e + f*x]^2)^m*(((a^2 - b^2*Sqrt[-c^2])*Hypergeometric2F1[1, 
1 + m, 2 + m, -((c^2*Tan[e + f*x]^2)/Sqrt[-c^2])]*(c*Tan[e + f*x])^(1 + m) 
)/(4*c^2*(1 + m)) + ((a^2 + b^2*Sqrt[-c^2])*Hypergeometric2F1[1, 1 + m, 2 
+ m, (c^2*Tan[e + f*x]^2)/Sqrt[-c^2]]*(c*Tan[e + f*x])^(1 + m))/(4*c^2*(1 
+ m)) + (2*a*b*Hypergeometric2F1[1, (3 + 2*m)/4, (7 + 2*m)/4, -(c^2*Tan[e 
+ f*x]^4)]*(c*Tan[e + f*x])^((3 + 2*m)/2))/(c^2*(3 + 2*m))))/(f*(c*Tan[e + 
 f*x])^m)
 

3.5.6.3.1 Defintions of rubi rules used

rule 30
Int[(u_.)*((a_.)*(x_))^(m_.)*((b_.)*(x_)^(i_.))^(p_), x_Symbol] :> Simp[b^I 
ntPart[p]*((b*x^i)^FracPart[p]/(a^(i*IntPart[p])*(a*x)^(i*FracPart[p]))) 
Int[u*(a*x)^(m + i*p), x], x] /; FreeQ[{a, b, i, m, p}, x] && IntegerQ[i] & 
&  !IntegerQ[p]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2370
Int[((Pq_)*((c_.)*(x_))^(m_.))/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[ 
{v = Sum[(c*x)^(m + ii)*((Coeff[Pq, x, ii] + Coeff[Pq, x, n/2 + ii]*x^(n/2) 
)/(c^ii*(a + b*x^n))), {ii, 0, n/2 - 1}]}, Int[v, x] /; SumQ[v]] /; FreeQ[{ 
a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[n/2, 0] && Expon[Pq, x] < n
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4153
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], 
 x]}, Simp[c*(ff/f)   Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f 
f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, 
n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio 
nalQ[n]))
 

rule 7267
Int[u_, x_Symbol] :> With[{lst = SubstForFractionalPowerOfLinear[u, x]}, Si 
mp[lst[[2]]*lst[[4]]   Subst[Int[lst[[1]], x], x, lst[[3]]^(1/lst[[2]])], x 
] /;  !FalseQ[lst] && SubstForFractionalPowerQ[u, lst[[3]], x]]
 
3.5.6.4 Maple [F]

\[\int \left (a +b \sqrt {c \tan \left (f x +e \right )}\right )^{2} \left (d \tan \left (f x +e \right )\right )^{m}d x\]

input
int((a+b*(c*tan(f*x+e))^(1/2))^2*(d*tan(f*x+e))^m,x)
 
output
int((a+b*(c*tan(f*x+e))^(1/2))^2*(d*tan(f*x+e))^m,x)
 
3.5.6.5 Fricas [F]

\[ \int (d \tan (e+f x))^m \left (a+b \sqrt {c \tan (e+f x)}\right )^2 \, dx=\int { {\left (\sqrt {c \tan \left (f x + e\right )} b + a\right )}^{2} \left (d \tan \left (f x + e\right )\right )^{m} \,d x } \]

input
integrate((a+b*(c*tan(f*x+e))^(1/2))^2*(d*tan(f*x+e))^m,x, algorithm="fric 
as")
 
output
integral(2*sqrt(c*tan(f*x + e))*(d*tan(f*x + e))^m*a*b + (b^2*c*tan(f*x + 
e) + a^2)*(d*tan(f*x + e))^m, x)
 
3.5.6.6 Sympy [F]

\[ \int (d \tan (e+f x))^m \left (a+b \sqrt {c \tan (e+f x)}\right )^2 \, dx=\int \left (d \tan {\left (e + f x \right )}\right )^{m} \left (a + b \sqrt {c \tan {\left (e + f x \right )}}\right )^{2}\, dx \]

input
integrate((a+b*(c*tan(f*x+e))**(1/2))**2*(d*tan(f*x+e))**m,x)
 
output
Integral((d*tan(e + f*x))**m*(a + b*sqrt(c*tan(e + f*x)))**2, x)
 
3.5.6.7 Maxima [F]

\[ \int (d \tan (e+f x))^m \left (a+b \sqrt {c \tan (e+f x)}\right )^2 \, dx=\int { {\left (\sqrt {c \tan \left (f x + e\right )} b + a\right )}^{2} \left (d \tan \left (f x + e\right )\right )^{m} \,d x } \]

input
integrate((a+b*(c*tan(f*x+e))^(1/2))^2*(d*tan(f*x+e))^m,x, algorithm="maxi 
ma")
 
output
integrate((sqrt(c*tan(f*x + e))*b + a)^2*(d*tan(f*x + e))^m, x)
 
3.5.6.8 Giac [F(-2)]

Exception generated. \[ \int (d \tan (e+f x))^m \left (a+b \sqrt {c \tan (e+f x)}\right )^2 \, dx=\text {Exception raised: RuntimeError} \]

input
integrate((a+b*(c*tan(f*x+e))^(1/2))^2*(d*tan(f*x+e))^m,x, algorithm="giac 
")
 
output
Exception raised: RuntimeError >> an error occurred running a Giac command 
:INPUT:sage2OUTPUT:Unable to divide, perhaps due to rounding error%%%{-1,[ 
0,1,0]%%%} / %%%{1,[0,0,2]%%%}+%%%{-1,[0,0,0]%%%} Error: Bad Argument Valu 
e
 
3.5.6.9 Mupad [F(-1)]

Timed out. \[ \int (d \tan (e+f x))^m \left (a+b \sqrt {c \tan (e+f x)}\right )^2 \, dx=\int {\left (a+b\,\sqrt {c\,\mathrm {tan}\left (e+f\,x\right )}\right )}^2\,{\left (d\,\mathrm {tan}\left (e+f\,x\right )\right )}^m \,d x \]

input
int((a + b*(c*tan(e + f*x))^(1/2))^2*(d*tan(e + f*x))^m,x)
 
output
int((a + b*(c*tan(e + f*x))^(1/2))^2*(d*tan(e + f*x))^m, x)